package io;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note1.txt");
        OutputStreamWriter oos = new OutputStreamWriter(fos,StandardCharsets.UTF_8);
        Scanner scan = new Scanner(System.in);
        while (true){
            String data = scan.nextLine();
            if("exit".equalsIgnoreCase(data)){
                break;
            }
            oos.write(data);
        }
        oos.close();
        System.out.println("完毕");
    }
}
